﻿
<script src="~/Scripts/View/RoleRightManage.js" type="text/javascript"></script>
<div id="layout-rolefunction" class="easyui-layout" style="width: 100%; height: 100%">
    <div data-options="region:'west',split:true,border:false" title="角色列表" style="width: 180px;border-right-width:1px;">
        <ul id="roleTree">
        </ul>
    </div>
    <div data-options="region:'center',border:false" style="border-left-width:1px;">
    </div>
</div>
<script type="text/javascript">
    $(function () {
        $('#roleTree').tree({
            url: "/RoleRight/RoleListForTree",
            onClick: function (node) {
                $("#layout-rolefunction").layout("panel", "center").panel('refresh', '/RoleRight/List?roleid=' + node.id + "&rolename=" + escape(node.text));
            },
            onLoadSuccess: function (node, data) {
                if (node == null) {
                    if ($("#layout-rolefunction").layout("panel", "center").html() == null || $("#layout-rolefunction").layout("panel", "center").html()=="") {
                        //加载完tree后，显示提示页面
                        $("#layout-rolefunction").layout("panel", "center").panel("refresh", "/Blank/Index?msg=" + escape("请选择角色，只能选择您管理范围内的角色"));
                    }
                }
            }
        });
    });
</script>

